local fenduan = fk.CreateSkill{
    name = "wk_heg__fenduan",
    tags = { Skill.MainPlace },
}

Fk:loadTranslationTable{
    ["wk_heg__fenduan"] = "忿断",
    [":wk_heg__fenduan"] = "主将技，当你选择执行<a href='heg_Command'>“军令”</a>时，你可改为横置；当你成为<a href='heg_Command'>“军令”</a>的目标结算后，"..
    "你令此<a href='heg_Command'>“军令”</a>的发起者弃置两张手牌，然后你交换主副将。",

    ["#wk_heg__fenduan-invoke"] = "忿断：是否将此次执行的军令改为横置",

    ["$wk_heg__fenduan1"] = "北伐之事，丞相亦听我定夺。",
    ["$wk_heg__fenduan2"] = "早知如此，投靠魏国又如何！",
}

local H = require "packages/ol_hegemony/util"
local HG = require "packages/new_heg_diy_my/util"

--需添加相应的执行军令时机 已在ol_hegemony中实现

fenduan:addEffect(H.ChooseDoCommand,{
    anim_type = "offensive",
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(fenduan.name) and target == player and not player.chained
      end,
    on_cost = function (self, event, target, player, data)
        return player.room:askToSkillInvoke(player,{skill_name = fenduan.name, prompt = "#wk_heg__fenduan-invoke"})
    end,
    on_use = function (self, event, target, player, data)
        player:setChainState(true)
        return true
    end,
})

fenduan:addEffect(H.AfterCommandUse,{
    anim_type = "offensive",
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(fenduan.name) and target == player
    end,
    on_cost = Util.TrueFunc,
    on_use = function (self, event, target, player, data)
        local room = player.room
        if data then
        room:askToDiscard(data.from,{
            min_num = 2,
            max_num = 2,
            include_equip = false,
            skill_name = fenduan.name,
            cancelable = false,
        })
        HG.SwapMainAndDeputy(room, player)
      end
    end,
})

return fenduan